

// const xhr = new XMLHttpRequest() ;

// xhr.open('get' , '/api/reg?username=yy&password=123' , true) ;

// xhr.send() ;

// xhr.onreadystatechange = function() {
//     if(xhr.readyState === 4 && xhr.status === 200) {
//         console.log(xhr.responseText);
//     }
// }


const xhr = new XMLHttpRequest() ;

xhr.open('post' , '/api/reg' , true) ;
xhr.setRequestHeader('content-type' , 'application/x-www-form-urlencoded');
xhr.send('username=yy&password=123') ;

xhr.onreadystatechange = function() {
    if(xhr.readyState === 4 && xhr.status === 200) {
        console.log(xhr.responseText);
    }
}